<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="cap.bean.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
    Admin admin = (Admin) request.getSession().getAttribute("admin");//管理员信息
    List<Article> artList=(List<Article>)request.getAttribute("artList");//所有文章
    List<Comment> cmtList=(List<Comment>)request.getAttribute("cmtList");//所有评论
    List<User> uList=(List<User>)request.getAttribute("uList");//所有用户
    Counter cnt=(Counter)request.getAttribute("cnt");//网站来访数
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>博客</title>
    <link href="<%=basePath%>bootstrap/css/blog-home.css"/>
    <link href="<%=basePath%>bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="<%=basePath%>bootstrap/js/jquery-2.1.1.js"></script>
</head>
<div class="container">
    <div class="col-md-12">
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="<%=basePath%>admin?method=index">博客管理系统</a>
            </div>

            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav side-nav">
                    <li class="active"><a href="<%=basePath %>admin?method=index"><i class="glyphicon glyphicon-dashboard"></i>控制面板</a></li>
                    <li><a href="<%=basePath %>admin?method=useradmin"><i class="glyphicon glyphicon-cog"></i> 用户管理</a></li>
                    <li><a href="<%=basePath %>admin?method=SysArticalAdmin"><i class="glyphicon glyphicon-cog"></i> 文章管理</a></li>
                    <li><a href="<%=basePath %>admin?method=SysCategoryAdmin"><i class="glyphicon glyphicon-edit"></i> 分类管理</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right navbar-user">
                    <li><a href="#"><i class="glyphicon glyphicon-user"></i>${admin.userName}</a></li>
                    <li><a href="<%=basePath%>admin?method=logout"><i class="glyphicon glyphicon-off"></i> 登出</a></li>
                </ul>
            </div>
        </nav>
    </div>
    <div style="position:relative;top: 80px">
        <div id="page-wrapper">
            <div class="row">
                <div class="col-md-12">
                    <h1>博客系统 <small>基于Bootstrap、Jsp和Servlet技术构建</small></h1>
                    <ol class="breadcrumb">
                        <li class="active"><i class="glyphicon glyphicon-dashboard"></i> 控制面板</li>
                    </ol>
                    <div class="row">
                        <div class="col-md-3">
                            <div class="panel panel-info">
                                <div class="panel-heading">
                                    <div class="row">
                                        <div class="col-xs-6">
                                            <i class="glyphicon glyphicon-search"></i>
                                        </div>
                                        <div class="col-xs-6 text-right">
                                            <p class="announcement-heading"></p>
                                            <p class="announcement-text"><%=cnt.getCount()%></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-3" >
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    <div class="row">
                                        <div class="col-xs-6">
                                            <i class="glyphicon glyphicon-edit"></i>
                                        </div>
                                        <div class="col-xs-6 text-right">
                                            <p class="announcement-heading"><%=artList.size()%></p>
                                            <p class="announcement-text">文章总数</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="panel panel-warning">
                                <div class="panel-heading">
                                    <div class="row">
                                        <div class="col-xs-6">
                                            <i class="glyphicon glyphicon-envelope"></i>
                                        </div>
                                        <div class="col-xs-6 text-right">
                                            <p class="announcement-heading"><%=cmtList.size()%></p>
                                            <p class="announcement-text">评论总数</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="panel panel-danger">
                                <div class="panel-heading">
                                    <div class="row">
                                        <div class="col-xs-6">
                                            <i class="glyphicon glyphicon-user"></i>
                                        </div>
                                        <div class="col-xs-6 text-right">
                                            <p class="announcement-heading"><%=uList.size()%></p>
                                            <p class="announcement-text">注册会员数</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<div><audio autoplay="autoplay" loop="true"><source src="music/1.mp3"></audio></div>
</body>
</html>